package com.danceforyou.payment.service.impl;

import com.danceforyou.common.service.impl.BaseServiceImpl;
import com.danceforyou.payment.dao.PaymentVoucherDAO;
import com.danceforyou.payment.model.PaymentVoucherDO;
import com.danceforyou.payment.service.PaymentVoucherService;
import com.danceforyou.payment.vo.PaymentVoucherVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 类名称：PaymentVoucherServiceImpl
* 创建人：danceforyou
* 创建时间：2021年02月05日
* 版本号：1.0v
*/
@Service("paymentVoucherService")
public class PaymentVoucherServiceImpl extends BaseServiceImpl<Long, PaymentVoucherDO, PaymentVoucherVO, PaymentVoucherDAO> implements PaymentVoucherService {
    @Autowired
    private PaymentVoucherDAO paymentVoucherDAO;

    @Override
    public PaymentVoucherDAO getDao() {
        return paymentVoucherDAO;
    }

    @Override
    public void saveInfo(PaymentVoucherDO paymentVoucher) {
        this.insert(paymentVoucher);
    }

    @Override
    public void updateInfo(PaymentVoucherDO paymentVoucher) {
        this.update(paymentVoucher);
    }

    @Override
    public int deleteInfoByIds(String ids) {
        String[] idArr = ids.split(",");
        int i = 0;
        for (String id : idArr) {
            i += this.deleteById(id);
        }
        return i;
    }
}
